//
// Created by xili on 2024/9/3 20:26.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int minimizeSum(vector<int>& a) {
        ranges::sort(a);
        int n = a.size();
        return min({a[n - 3] - a[0], a[n - 2] - a[1], a[n - 1] - a[2]});
    }
};